<%@page import="java.util.Date"%>
<%@page import="java.util.List"%>
<%@page import="org.zty.service.PojoService"%>
<%@page import="org.zty.domain.Pojo"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="common/taglib.jsp" %>
<%@include file="common/page.jsp" %>
<%
Pojo pojo = new Pojo();

p.setPageSize(5);
PojoService ps = new PojoService();
p.setTotalCount(ps.findPojoTotal(pojo));
pojo.setPageIndex(p.getPageIndex());
pojo.setPageSize(p.getPageSize());

List<Pojo> pojoList =ps.findPojoList(pojo); 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${projectName}</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<%@include file="common/js_css.jsp" %>
<style>
</style>
<script>
var dg;
function add() {
	dg=$.dialog({title:'创建java豆',content: 'url:${ctx}/pojo_add.jsp',max:true,min:true,width:1300,height:700,lock:true});
	//parent.dg.max();
}
function del(id) {
	if(confirm("确认删除java豆")){
		
	$.ajax({
		url:"pojo_do.jsp",
		cache:false,
		type : 'GET',
		dataType : "json",
		data:{'m':'delete','id':id},
		success:function(data){
			if(data.msg=='true'){
				location.reload();
			}else{
			
			}
		}
	});
	}
}

function update(id) {
	dg=$.dialog({title:'修改java豆',content: 'url:${ctx}/pojo_update.jsp?id='+id,max:true,min:true,width:1300,height:700,lock:true});
}

</script>
</head>

<body>

<div style="width:1000px;margin:0px auto;">
<div class="function_block function_block_c1 fleft" style="height:80px;width:180px;margin-top:10px;margin-left:10px;" onclick="add()">
	<div class="function_block_text">创建java豆</div>
	<div class="function_block_pic" style="height:42px;width:35px;"></div>
</div>
<table class="list_table" cellspacing=0 cellpadding=5 border=0 style="width:100%;">
	<thead style="text-align:left;">
		<tr>
			<td class="td1" align="center">id</td>
			<td class="td2" align="center">name</td>
			<td class="td1" align="center">tableName</td>
			<td class="td2" align="center">descstr</td>
			<td class="td1" align="center">crTime</td>
			<td class="td2" align="center">updateTime</td>
			<td class="td1" align="center">操作</td>
		</tr>
	</thead>
	<tbody>
		<%
		for(int i =0;i<pojoList.size();i++){
			Pojo tmp = pojoList.get(i);
		%>
		<tr class="<%=i%2==0?"tr2":"tr1"%>">
			<td class="td1" align="center"><%=tmp.getId()%></td>
			<td class="td2" align="center"><%=tmp.getName()%></td>
			<td class="td1" align="center"><%=tmp.getTableName()%></td>
			<td class="td2" align="center"><%=tmp.getDescstr()%></td>
			<td class="td1" align="center"><%=tmp.getCrTime()%></td>
			<td class="td2" align="center"><%=tmp.getUpdateTime()%></td>
			<td class="td1" align="center"><a style="cursor:pointer;" onclick="del(<%=tmp.getId()%>)">删除</a> <a style="cursor:pointer;" onclick="update(<%=tmp.getId()%>)">修改</a></td>
		</tr>
		<%}%>
	</tbody>
</table>


<%@include file="../../common/pagebar.jsp" %>
	</div>
</body>
</html>
